using System;
using NUnit.Framework;
using OpenRay;

namespace Tests
{
	[TestFixture]
	public class TestPoint
	{
		[Test]
		public void TestPointSet()
		{
			Point v = new Point(0f, 1f, 2f, 1f);
			
			Assert.AreEqual( 0f, v.X );
			Assert.AreEqual( 1f, v.Y );
			Assert.AreEqual( 2f, v.Z );
		}
		
		[Test]
		public void TestAdd()
		{
			Point p = new Point(0f, 1f, 2f, 1f);
			Vector v = new Vector(1f, 2f, 3f);
			
			Assert.AreEqual( new Point(1f, 3f, 5f, 1f), p + v );
		}
		
		[Test]
		public void TestSubtract()
		{
			Point p1 = new Point(1f, 2f, 3f, 1f);
			Point p2 = new Point(0f, 0f, 0f, 1f);
				
			Vector t = new Vector(1f, 2f, 3f);
			
			Assert.AreEqual( new Vector(-1, -2, -3), p2 - p1 );
			Assert.AreEqual( p2, p1 - t );
		}
	}
}

